<?php
function include_files($pfad, $report = false){
    foreach($pfad as $file)
    {
        $includes = opendir ($file);

        while ($includefile = readdir ( $includes ) )
        {
            if($includefile == '.' || $includefile == '..'){
                continue;
            }

            $fileName = $file.$includefile;
            
            if((is_file($fileName))){
                if($report){
                    echo' Die Datei <b>'.$includefile.'</b> wurde eingebunden<br>';
                }
                include($fileName);

            } else if(is_dir($fileName)){
                 if($report){
                    echo' Die Datei <b>'.$includefile.'</b> ist ein Verzeichnis<br>';
                }
                include_files(array($fileName."/"));
            }
        }
        closedir ($includes);
    }
}
?>